// types.ts

export interface Columns {
	[propName: string]: any
}

// 查询方法
// interface queryActionType {
//   (arg: any): Promise<any>;
// }

// 生成表头方法
// export interface ColumnFunc {
//   (updateMethod?: queryActionType): Array<Columns>;
// }

// 页码状态
export interface paginationInitialType {
	current?: number
	size?: number
}

// 表格组件Props
export interface ArgTableProps {
	columns: any[]
	total?: any
	params?: any
	defaultCurrent?: number
	noInit?: boolean
	kid?: any
	scroll?: any
	callback?: (pagination?: paginationInitialType) => void
	dataSource: any[]
	loading?: boolean
	pagination?: boolean
	showRowSelection?: boolean
	defaultSelectedRowKeys?: any[]
	pageSizeOptions?: any[]
	selectCallback?: (key: any, data: any) => void
	getCheckboxProps?: any
	type?: string
	bordered?: boolean
	pageSizeOptionsKey?: any
	clearSelection?: any
}

// 表格组件Props
export interface TableProps {
	defaultSelectedRowKeys?: any[]
	rowKey?: any
	scroll?: { x: string }
	className?: string
	rowSelection?: any
	columns: any[]
	dataSource: any[]
	loading?: boolean
}

// 表格初始化状态
export interface initialStateType {
	loading: boolean
	pagination: paginationInitialType
	dataSource: Array<any>
}

// 操作类型
export interface actionType {
	type: string
	payload?: any
}
